//
// CPSBinOp.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CPSBinOp {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPSBinOp(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSBinOp obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSBinOp(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CPSBinOp() {
    this(nel3dJNI.new_CPSBinOp(), true);
  }

  public final static class BinOp {
    public final static BinOp selectArg1 = new BinOp("selectArg1", nel3dJNI.CPSBinOp_selectArg1_get());
    public final static BinOp selectArg2 = new BinOp("selectArg2");
    public final static BinOp modulate = new BinOp("modulate");
    public final static BinOp add = new BinOp("add");
    public final static BinOp subtract = new BinOp("subtract");
    public final static BinOp last = new BinOp("last");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static BinOp swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + BinOp.class + " with value " + swigValue);
    }

    private BinOp(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private BinOp(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private BinOp(String swigName, BinOp swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static BinOp[] swigValues = { selectArg1, selectArg2, modulate, add, subtract, last };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
